<!DOCTYPE html>
<html lang="zh">
<head>
    {include file="Public/header"}
</head>
<body style="position: absolute;width: 100%;height: 100%;">
<iframe src="{$url}/horizon/workflow/support/open.wf?workId={:request()->param('workId')}&trackId={:request()->param('trackId')}&loginName={$login_name}&password={$login_pwd}&tenantCode=system" frameborder="0" width="100%" height="100%" id="iframepage"></iframe>
<!--<iframe src="{$url}/workflow/module/workflow/flow.info.html?workId={:request()->param('workId')}" frameborder="0" width="100%" height="100%" id="iframepage"></iframe>-->
<!--<iframe src="{$url}/horizon/workflow/support/open.wf?workId={:request()->param('workId')}&trackId={:request()->param('trackId')}&accessToken={$accessToken}&tenantCode=system" frameborder="0" width="100%" height="100%" id="iframepage"></iframe>-->
<a href="{:url('workflowdb/index')}" id="guanbi" class="btn btn-primary" style="position:absolute;right:22px;top:3px;padding: 6px 18px;">关闭</a>
</body>
{include file="Public/footer"}
<script>
    $(function () {

        var hasdb={$hasdb};
        if(hasdb==0){
            $("#iframepage").attr("src","{$url}/workflow/module/workflow/flow.info.html?workId={:request()->param('workId')}&trackId={:request()->param('trackId')}");
            
        }else{
            var time1=setInterval(checkstate, 1000);
        }
        
        var now_state='{$now_state}';
        var workId="{:request()->param('workId')}"
        var trackId="{:request()->param('trackId')}"

        function checkstate(){
            $.post("{:url('checkstate')}",{workId:workId,trackId:trackId},function(re){
                if(re!=now_state){
                    clearInterval(time1);
                    $("#iframepage").attr("src","{$url}/workflow/module/workflow/flow.info.html?workId={:request()->param('workId')}&trackId={:request()->param('trackId')}");
                }
            })
        }
        function changeFrameHeight(){
            var ifm= document.getElementById("iframepage");
            ifm.height=document.documentElement.clientHeight;
        }
        window.onresize=function(){
            changeFrameHeight();
        }
    })
</script>
</html>